package com.iob.coin.controller.kgqa;

import com.iob.coin.bl.kgqa.KgQAService;
import com.iob.coin.vo.ResponseVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.websocket.server.PathParam;

/**
 * @Author: GuoXinyuan
 * @Date: 2021/6/10
 */
@RestController
@CrossOrigin
@RequestMapping("/kgqa")
public class KgQAController {

    @Autowired
    KgQAService kgQAService;

    @PostMapping("/ask")
    public ResponseVO ask(@PathParam("question") String question,
                          @PathParam("step") int step,
                          @PathParam("cur") int cur){
        return kgQAService.askInStep(question, step, cur);
    }

    @PostMapping("/askForRecommend")
    public ResponseVO askForRecommend(@PathParam("uri") String uri) {
        ResponseVO responseVO = kgQAService.askForRecommend(uri);
        return responseVO;
    }

}
